import request from "@/utils/request";
import {
    barInter,
    pieInter,
    consultingManagement,
    consultingTeacher,
    Arrive,
    noBook,
    viewArticle,
    articelType,
    article,
    img,
    delart,
    editarticle,
    detailsart,
    addTeacher,
    editClass,
    psychological, addpsychological, PsychometricTitle, PsychometricSet
} from '@/api/interface/interfaceRequest';

//首页每日访问
function getIndexEcharts() {
    return request({
        url: '/system/index/data',
        method: 'get'
    })
}

//首页柱状图
function getIndexBar(params: barInter) {
    return request({
        url: '/system/index/bar',
        method: 'get',
        params
    })
}

//首页饼状图
function getIndexPie(params: pieInter) {
    return request({
        url: '/system/index/pie',
        method: 'get',
        params
    })
}

//咨询管理学生班级
function getStudentClass(params: consultingManagement) {
    return request({
        url: '/student/class/list',
        method: 'get',
        params
    })
}

//咨询管理老师
function getTeacher(params: consultingTeacher) {
    return request({
        url: '/system/teacher/list',
        method: 'get',
        params
    })
}

//咨询管理预约
function getAppointment(params: consultingManagement) {
    return request({
        url: '/appointment/list',
        method: 'get',
        params
    })
}

//修改状态
function changeArrive(data: Arrive) {
    return request({
        url: '/appointment/edit',
        method: 'put',
        data
    })

}

//禁止预约
function noBooking(data: noBook) {
    return request({
        url: '/student/forbidden/create',
        method: 'post',
        data
    })
}

//取消禁止预约
function cancelNoBooking(data: noBook) {
    return request({
        url: '/student/forbidden/cancel',
        method: 'put',
        data
    })
}

//查看文章
function viewArticles(params: viewArticle) {
    return request({
        url: '/system/article/list',
        method: 'get',
        params
    })
}

//增加文章
function addArticles(data: article) {
    return request({
        url: '/system/article',
        method: 'post',
        data
    })
}

//获取文章类型
function articleType(params: articelType) {
    return request({
        url: '/system/category/list',
        method: 'get',
        params
    })
}

//编辑文章
function editArticles(data: editarticle) {
    return request({
        url: '/system/article',
        method: 'put',
        data
    })
}

//删除文章
function delArticles(ids: string) {
    // console.log(data)
    return request({
        url: `/system/article/${ids}`,
        method: 'DELETE',
    })
}

//详情文章
function detailsArticles(id: string) {
    return request({
        url: `/system/article/${id}`,
        method: 'get',
    })
}

//学院列表
function collegeList() {
    return request({
        url: '/system/dept/list',
        method: 'get',
    })
}

//展示班级列表
function classList(params: viewArticle) {
    return request({
        url: '/student/class/list',
        method: 'get',
        params
    })
}

//删除班级
function delClassList(data: string[]) {
    return request({
        url: '/student/class/delete',
        method: 'post',
        data
    })
}

//单次添加班级
function addClassList(data:addTeacher){
    return request({
        url: '/student/class/addClass',
        method: 'post',
        data
    })
}

//获取老师列表
function getTeacherList(){
    return request({
        url: '/system/user/teacherlist',
        method: 'get',
    })
}
//编辑班级列表
function editClassList(data:editClass){
    return request({
        url: '/student/class/update',
        method: 'post',
        data
    })
}

//查看心理测评
function psychologicalEvaluation(params:psychological){
    return request({
        url: '/evaluation/management/list',
        method: 'get',
        params
    })
}

//增加心理测评
function addpsychologicalEvaluation(data:addpsychological){
    // console.log(data);
    return request({
        url: '/evaluation/management/add',
        method: 'post',
        data
    })
}
// 删除心理测评
function deletePsychometricAssessments(ids:string){
    return request({
        url: `/evaluation/management/del/${ids}`,
        method: 'delete'
    })
}
// 获取心理测评详情
function getPsychometricDetail(id:string) {
    return request({
        url: `/evaluation/management/editreturn/${id}`,
        method: 'get'
    })
}
// 提交心理测评修改
function modifyPsychometric(data:addpsychological){
    return request({
        url:  '/evaluation/management/edit',
        method: 'put',
        data
    });
}
// 获取心理测评题目详情
function  getPsychometricTitleDetails(params:PsychometricTitle){
    return request({
        url:  '/evaluation/management/title/details',
        method: 'get',
        params
    });
}
// 添加心理测评题目
function addPsychometricTitle(data:any){
    return request({
        url:  '/evaluation/management/title/add',
        method: 'post',
        data
    });
}
// 编辑心理测评题目
function modifyPsychometricTitle(data:any){
    return request({
        url:  '/evaluation/management/title/edit',
        method: 'put',
        data
    });
}
// 获取某个心理测评题目
function getPsychometricTitle(id:string){
    return request({
        url: `/evaluation/management/title/editreturn/${id}`,
        method: 'get'
    })
}
// 删除心理测评题目
function deletePsychometricTitle(ids:string){
    return request({
        url: `/evaluation/management/title/del/${ids}`,
        method: 'delete'
    })
}
// 获取心理测评设置
function getSetList(params:PsychometricSet){
    return request({
        url: '/evaluation/management/set/list',
        method: 'get',
        params
    })
}
// 添加心理测评设置
function addPsychometricSet(data:any){
    return request({
        url: '/evaluation/management/set/add',
        method: 'post',
        data
    })
}
// 编辑心理测评设置
function modifyPsychometricSet(data:PsychometricSet){
    return request({
        url:  '/evaluation/management/set/edit',
        method: 'put',
        data
    });
}
// 获取某个心理测评设置
function getPsychometricSet(id:string){
    return request({
        url: `/evaluation/management/set/editreturn/${id}`,
        method: 'get'
    })
}
// 删除心理测评设置
function deletePsychometricSet(ids:string){
    return request({
        url: `/evaluation/management/set/del/${ids}`,
        method: 'delete'
    })
}
export {
    getIndexEcharts, getIndexBar, getIndexPie, getStudentClass,
    getTeacher, getAppointment, changeArrive, noBooking, cancelNoBooking,
    viewArticles, addArticles, articleType, editArticles, delArticles,
    detailsArticles, collegeList, classList, delClassList,addClassList,
    getTeacherList,editClassList,psychologicalEvaluation,addpsychologicalEvaluation,deletePsychometricAssessments,
    getPsychometricDetail,modifyPsychometric,getPsychometricTitle,addPsychometricTitle,modifyPsychometricTitle,
    deletePsychometricTitle,getPsychometricTitleDetails,getSetList,addPsychometricSet,modifyPsychometricSet,
    getPsychometricSet,deletePsychometricSet
}
